Skip to content

Introduce message class resolver#310

Merged
samdark merged 3 commits into
masterfrom
message-class-resolver
Jun 16, 2026
Merged

Introduce message class resolver#310
samdark merged 3 commits into
masterfrom
message-class-resolver

Conversation

@vjik

@vjik vjik commented Jun 15, 2026

Copy link
Copy Markdown
Member
Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️
Tests pass? ✔️
Fix #292

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (31c3cb5) to head (266bc9f).

Files with missing lines Patch % Lines
src/Message/Serializer/MessageSerializer.php 0.00% 5 Missing ⚠️
...essage/ClassResolver/ArrayMessageClassResolver.php 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             master    #310   +/-   ##
========================================
  Coverage      0.00%   0.00%           
+ Complexity      336     334    -2     
========================================
  Files            50      51    +1     
  Lines           920     918    -2     
========================================
+ Misses          920     918    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vjik vjik requested a review from a team June 15, 2026 14:14
@vjik vjik added the status:code review The pull request needs review. label Jun 15, 2026
Comment thread config/di.php Outdated
Comment thread config/params.php Outdated
'middlewares-push' => [],
'middlewares-consume' => [],
'middlewares-fail' => [],
'message-class-map' => [],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'message-class-map' => [],
'messages' => [],

I'd also move that as 1st array key so it will be message, handlers etc. The drawback here is that we repeat the same thing two times:

'messages' => [
    'process-pdf' => ProcessPdfMessage::class,
],
'handlers' => [
    'process-pdf' => ProcessPdfMessageHandler::class,
],

Could be possibly combined:

'messages' => [
    'process-pdf' => [ProcessPdfMessage::class, ProcessPdfMessageHandler::class],
],

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest extracting it into a separate issue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought more about it. Not a good idea since messages are class-only while handlers are definitions.

Comment thread docs/guide/en/configuration-with-config.md Outdated
Comment thread docs/guide/en/configuration-with-config.md Outdated
Comment thread docs/guide/en/configuration-with-config.md Outdated
Comment thread src/Message/ClassResolver/ArrayMessageClassResolver.php
@vjik vjik requested a review from samdark June 16, 2026 05:46
@samdark samdark merged commit fd6d760 into master Jun 16, 2026
28 of 29 checks passed
@samdark samdark deleted the message-class-resolver branch June 16, 2026 21:07
@samdark

samdark commented Jun 16, 2026

Copy link
Copy Markdown
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid having PHP class in the message after serialization

2 participants